!function(e) {
    function t(o) {
        if (n[o])
            return n[o].exports;
        var r = n[o] = {
            exports: {},
            id: o,
            loaded: !1
        };
        return e[o].call(r.exports, r, r.exports, t),
        r.loaded = !0,
        r.exports
    }
    var n = {};
    return t.m = e,
    t.c = n,
    t.p = "",
    t(0)
}({
    0: function(e, t, n) {
        "use strict";
        function o(e) {
            return e && e.__esModule ? e : {
                default: e
            }
        }
        function r(e, t) {
            window.parent.postMessage(JSON.stringify({
                type: e,
                content: t
            }), "*")
        }
        var a = n(18)
          , i = o(a)
          , c = n(8)
          , u = o(c)
          , s = n(17)
          , d = o(s);
        window.__saveUserId = function(e) {
            i.default.set("userId", e)
        }
        ,
        window.iframeStartup = function() {
            window.parent !== window || window.__testMode__ ? (window.addEventListener("message", function(e) {
                if (e.data) {
                    var t = void 0;
                    try {
                        t = JSON.parse(e.data)
                    } catch (e) {
                        u.default.log("error parse ", e)
                    }
                    if (t && t.type)
                        switch (t.type) {
                        case "setBucUserId":
                            i.default.set("userId", t.content, {
                                domain: ".alipay.com",
                                samesite: "none",
                                secure: !0
                            }),
                            r("getBucUserId", t.content);
                            break;
                        case "getBucUserId":
                            r("getBucUserId", i.default.get("userId", {
                                domain: ".alipay.com"
                            }));
                            break;
                        case "storage":
                            (0,
                            d.default)(t)
                        }
                }
            }, !1),
            window.onload = function() {
                var e = i.default.get("userId", {
                    domain: ".alipay.com"
                });
                r("iframOnload"),
                r("getBucUserId", e || null)
            }
            ) : u.default.log("DO NOT OPEN ME DIRECTLY!")
        }
    },
    8: function(e, t) {
        "use strict";
        Object.defineProperty(t, "__esModule", {
            value: !0
        });
        var n = ["log", "info", "warn", "error"]
          , o = {};
        n.forEach(function(e) {
            o[e] = function() {
                var t;
                console && console[e] && (t = console)[e].apply(t, arguments)
            }
        }),
        t.default = o,
        e.exports = t.default
    },
    17: function(e, t, n) {
        "use strict";
        function o(e) {
            return e && e.__esModule ? e : {
                default: e
            }
        }
        function r(e) {
            window.parent.postMessage(JSON.stringify(e), "*")
        }
        function a(e) {
            r({
                type: "getStorage",
                key: e,
                value: localStorage.getItem(e)
            })
        }
        function i(e, t) {
            var n = "setStorage";
            try {
                localStorage.setItem(e, t),
                r({
                    type: n,
                    key: e,
                    success: !0
                })
            } catch (t) {
                r({
                    type: n,
                    key: e,
                    success: !1
                }),
                u.default.log("Tracert \u8bbe\u7f6eStorage\u5931\u8d25", t)
            }
        }
        Object.defineProperty(t, "__esModule", {
            value: !0
        }),
        t.default = function(e) {
            if (window.localStorage) {
                var t = e.action
                  , n = e.key
                  , o = e.value;
                "set" === t && i(n, o),
                "get" === t && a(n)
            }
        }
        ;
        var c = n(8)
          , u = o(c);
        e.exports = t.default
    },
    18: function(e, t, n) {
        var o, r;
        !function(a) {
            var i;
            if (o = a,
            r = "function" == typeof o ? o.call(t, n, t, e) : o,
            !(void 0 !== r && (e.exports = r)),
            i = !0,
            e.exports = a(),
            i = !0,
            !i) {
                var c = window.Cookies
                  , u = window.Cookies = a();
                u.noConflict = function() {
                    return window.Cookies = c,
                    u
                }
            }
        }(function() {
            function e() {
                for (var e = 0, t = {}; e < arguments.length; e++) {
                    var n = arguments[e];
                    for (var o in n)
                        t[o] = n[o]
                }
                return t
            }
            function t(e) {
                return e.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent)
            }
            function n(o) {
                function r() {}
                function a(t, n, a) {
                    if ("undefined" != typeof document) {
                        a = e({
                            path: "/"
                        }, r.defaults, a),
                        "number" == typeof a.expires && (a.expires = new Date(1 * new Date + 864e5 * a.expires)),
                        a.expires = a.expires ? a.expires.toUTCString() : "";
                        try {
                            var i = JSON.stringify(n);
                            /^[\{\[]/.test(i) && (n = i)
                        } catch (e) {}
                        n = o.write ? o.write(n, t) : encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent),
                        t = encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape);
                        var c = "";
                        for (var u in a)
                            a[u] && (c += "; " + u,
                            a[u] !== !0 && (c += "=" + a[u].split(";")[0]));
                        return document.cookie = t + "=" + n + c
                    }
                }
                function i(e, n) {
                    if ("undefined" != typeof document) {
                        for (var r = {}, a = document.cookie ? document.cookie.split("; ") : [], i = 0; i < a.length; i++) {
                            var c = a[i].split("=")
                              , u = c.slice(1).join("=");
                            n || '"' !== u.charAt(0) || (u = u.slice(1, -1));
                            try {
                                var s = t(c[0]);
                                if (u = (o.read || o)(u, s) || t(u),
                                n)
                                    try {
                                        u = JSON.parse(u)
                                    } catch (e) {}
                                if (r[s] = u,
                                e === s)
                                    break
                            } catch (e) {}
                        }
                        return e ? r[e] : r
                    }
                }
                return r.set = a,
                r.get = function(e) {
                    return i(e, !1)
                }
                ,
                r.getJSON = function(e) {
                    return i(e, !0)
                }
                ,
                r.remove = function(t, n) {
                    a(t, "", e(n, {
                        expires: -1
                    }))
                }
                ,
                r.defaults = {},
                r.withConverter = n,
                r
            }
            return n(function() {})
        })
    }
});
